resetTeacherPassword1 = function(){
	Ext.define('teacherModel',{
		extend:'Ext.data.Model',
		fields:[ 
		        	{name:'teacherId',type:'String'},
		        	{name:'teacherName',type:'string'},
		        	{name:'account',type:'string'},
			        {name:'password',type:'string'},
			        {name:'job',mapping:'job.valueId',type:'string'},
			        {name:'political',mapping:'political.valueId',type:'string'},
			        {name:'academy',mapping:'academy.valueId',type:'string'}
			       ],
		idProperty : 'teacherId'
	});
	

	var store = Ext.create('Ext.data.Store',{
		pageSize:8,
		model:teacherModel,
		autoLoad:true,
		proxy:{
			type:'ajax',
			url:'searchAllTeacherAction.action',
			reader:{
				type:'json',
				root:'resultList.list',
				totalProperty:'resultList.total'
			}
		}
	});
	

	var grid = Ext.create('Ext.grid.Panel',{
		store:store,	
		columnLines:true,
		//selModel:checkBox,
		disableSelection:false,
		//width:600,
		loadMask:true,
		
		columns:[
		         {text:'编号',width:100,dataIndex:'teacherId',sortable:true},
		         {text:'姓名',width:100,dataIndex:'teacherName',sortable:true},
		         {text:'登录账号',width:50,dataIndex:'account',sortable:true},
		         {text:'政治面貌',width:100,dataIndex:'political',renderer:function(v){
		        	 var teacherPoliticalForMStore = getStaticDataStore("political status");
		        	 var index = teacherPoliticalForMStore.find('valueId',v); 
        			 if(index != -1){
        				 var r = teacherPoliticalForMStore.getAt(index);
        				 return r.get("valueName");
        			 }
        			 else{
        				 return v;
        			 }
        		 } },
		         {text:'职称',width:80,dataIndex:'job',sortable:true,renderer:function(v){
        			 var teacherJobForMStore = getStaticDataStore("teacher job");
		        	 var index = teacherJobForMStore.find('valueId',v); 
        			 if(index != -1){
        				 var r = teacherJobForMStore.getAt(index);
        				 return r.get("valueName");
        			 }
        			 else{
        				 return v;
        			 }
        		 } },
		         {text:"学院",width:100,dataIndex:'academy',sortable:true,renderer:function(v){
		        	 var teacherAcademyForMStore = getStaticDataStore("academy");
		        	 var index = teacherAcademyForMStore.find('valueId',v); 
        			 if(index != -1){
        				 var r = teacherAcademyForMStore.getAt(index);
        				 return r.get("valueName");
        			 }
        			 else{
        				 return v;
        			 }
        		 } }
		         
		         ],
		autoHeight:true,
		authWidth:true,

		title:"导师列表",
		loadMask:true,
		pageSize:5,
		dockedItems:[{
			dock:'top',
			xtype:'toolbar',
			
			items:[{
				width:300,
				fieldLabel:'搜索',
				labelWidth:70,
				xtype:'searchfield',
				store:store			
			},{
				xtype:'label',
				html:'<div style="font-size:12px;color:red">*支持姓名的模糊查询，双击进入密码重置(重置后，密码为6个0)</div>'
			}]		
		},
		{
			dock:'bottom',
			xtype:'pagingtoolbar',	
			store:store,
			displayInfo:true,
			displayMsg:'显示{0}-{1}条，共计{2}条',
			emptyMsg:"没有数据"
		}],
		listeners:{  

			//双击事件
			itemdblclick : function( grid, record, item, index, e, eOpts){  
				var selectedKeys = grid.getSelectionModel().getSelection();
				resetTeacherPassword(selectedKeys[0]);
			       }  
		}
	});
	
	function resetTeacherPassword(data){
		Ext.MessageBox.confirm('提示', '确定重置导师：'+data.get('teacherName')+'('+data.get('teacherId')+')'+'的资料下载密码吗？', function(btn){
			
			if(btn == 'yes'){
				var teacherId = data.get('teacherId');
				Ext.Ajax.request({  
			        url : "resetTeacherPasswordAction.action",  
			        params : {  
			        	teacherId:teacherId,
			        	flag:false
			        },  
			        method : 'POST',  
			        success : function(response, opts) {  
			            var success = Ext.decode(response.responseText).flag;  
			            // 当后台数据同步成功时  
			            if (success) {  
			            	Ext.Msg.alert("提示","密码重置成功！");
			            	//Ext.getCmp('editSummaryId').close();
			            } else {  
			            	Ext.Msg.alert("提示",Ext.decode(response.responseText).msg);
			            }  
			        }  
			        
			    });  
			}
		}); 
		
	}
	
	
	return grid;
	
	
}